package xyz.yuanjilu.service;

import java.util.List;
import java.util.Map;

import org.activiti.bpmn.model.Process;
import org.springframework.http.ResponseEntity;

import xyz.yuanjilu.entity.BpmNodeRuleEntity;

public interface BPMService {
	
	/**
	 * 更新系统的用户信息到工作流中
	 */
	void reflashIdentity();
	
	 /**
     *获取流程图所有节点和连线
     * @param modelId 模型id
     * @return
     */
    List<Map<String,String>> getModelNode(String modelId) throws Exception;
    
    /**
     * 查看流程图片
     * @param modelId
     * @return
     */
    ResponseEntity<byte[]> showModelFlowImg(String modelId);
    
    /**
     * 查看流程节点规则
     * @param modelId
     * @return
     */
	List<BpmNodeRuleEntity> getModelNodeRule(String modelId,String nodeId);
	
	/**
     * 查看流程节点规则
     * @param modelId
     * @return
     */
	List<BpmNodeRuleEntity> getModelNodeRule(String modelId,String nodeId,String deploymentId);
	
	/**
	 * 部署业务流程规则
	 * @param modelId
	 * @param deploymentId
	 */
	void deploymentModelRule(String modelId,String deploymentId);

	List<Map<String, String>> getModelNode(Process process) throws Exception;

	List<Map<String, String>> getProcessDefinitionNode(String processDefinitionId) throws Exception;

	List<BpmNodeRuleEntity> getProcessDefinitionNodeRule(String processDefinitionId, String nodeId);

	List<BpmNodeRuleEntity> getProcessDefinitionNodeRule(String processDefinitionId);
	
	/**
	 *  获取运行中任务节点的按钮配置
	 * @param processDefinitionId 流程部署ID
	 * @param nodeId 流程的节点ID
	 * @return
	 * @throws Exception
	 */
	List<BpmNodeRuleEntity> getRuntimeTaskButton(String processDefinitionId,String nodeId) throws Exception;
	
	/**
	 * 获取按钮下面的规则配置
	 * @param ruleId
	 * @return
	 * @throws Exception
	 */
	List<BpmNodeRuleEntity> getRuntimeTaskButtonRule(String ruleId) throws Exception;
}
